The Oath Between Amaterasu and Susano (アマテラスとスサノオの誓約)

Both the Kojiki (Records of Ancient Matters) and the Nihonshoki (Chronicles of Japan) give an account of an Ukei (an oath) between Amaterasu and Susano, and of the gods who came into being due to it.

Summary
The Kojiki
When his father Izanagi told Susano to rule the ocean, Susano cried and whined, saying that he wanted to go to Nenokuni (or Yomi, the land of the dead) where his mother Izanami was, and caused tremendous damage to heaven and earth.
Izanagi got angry about it, and sent Susano into exile, proclaiming, 'Then, you shall not live in this country.'

Susano thought that he would go to the Nenokuni after he told his sister Amaterasu Omikami (the Sun Goddess), and ascended to Takamanohara (the plain of high heaven) where she ruled. Amaterasu thought that Susano had come to usurp Takamanohara, and met Susano with a bow and arrow in her hands.

Susano suggested to Amaterasu that they swear an Ukei (written as 宇気比 or 誓約 in Chinese characters) to dispel her doubt. The two gods swore the oath, being on opposite sides of Ame no Yasu-kawa River (the tranquil river of Heaven). First, Amaterasu received the Totsuka no Tsurugi (literally "the ten-hands-long sword") that Susano had, and she crunched it down. The following three female gods (Munakata Sanjojin [three goddesses enshrined in Munakata Taisha Shrine]) came into being from the misty spray that she blew out. People in Munakata believe in these female gods who have been enshrined in the Munakata-taisha Shrine.

Takiri bime no mikoto:
Also known as Okitsushima hime no mikoto. She has been enshrined in the Okitsu-miya.

Ichikishima hime no mikoto:
Also known as Sayori bime no mikoto. She has been enshrined in the Nakatsu-miya.

Takitsu hime no mikoto:
She has been enshrined in the Hetsu-miya.

Next, Susano received the '500 beads of the necklace with Yasakani no magatama (comma-shaped beads),' that Amaterasu had, and crunched it down.
The following five male gods came into being from the misty breath he sprayed out:

Masakatsuakatsu kachihayahi ame no oshihomimi no mikoto was born from the beads wrapped around her left mizura (hair-bunch). Amenohohi no mikoto was born from the beads wrapped around her right mizura. Amatsuhikone no mikoto was born from the beads wrapped around her kazura (wig). Ikutsuhikome no mikoto was born from the beads wrapped around her left arm. Kumanokusubi no mikoto was born from the beads wrapped around her right arm.

Amaterasu announced that she would take the later male gods to bring them up as her own offspring because they were born from her possession, and that the former female gods were Susano's offspring because they were born from his possession. Susano said that his children were the goddesses of graceful nature because his heart was guiltless, and Amaterasu pardoned Susano.

The Nihonshoki (Chronicles of Japan)
In the text of the Nihonshoki, Susano bore five male gods and proved that he did not have any evil intentions.

In the arufumi (alternate writing) of the first and the third volumes, the two gods agreed that the one whose offspring were male would win, and produced children without exchanging things. That is to say, this story develops as follows: Amaterasu gave birth of female gods from the Totsuka no Tsurugi and Susano bore male gods using his own magatama (comma-shaped beads), then Susano won.
(In the arufumi of the third volume, Susano gave birth of six male gods.)

In the arufumi of the second volume, the story is almost the same as the one in the Kojiki that they agreed that the one who bore male gods would win, but it is not mentioned which gods are whose offspring. If the judgment is also the same as the Kojiki (to be an offspring of a god who owned the thing), it results in Amaterasu's victory.

In either case, it is said that the god who produced male gods would win. The following theory has been most influential: As the Kojiki was compiled and edited in the period of the empress, such as Empress Jito and the Empress Genmei; the story in it was altered so that the goddess won.

Commentary
There is a theory saying that Susano won in the original legend by producing a male god and that Masakatsuakatsu kachihayahi was Susano's offspring by the following reasons.

The name Masakatsuakatsu means 'I will win without doubt and I will win,' and Susano won in the Nihonshoki.

In the Kojiki, it says that Amaterasu took on Kachihayahi and looked after him.

In the Nihonshoki, Amaterasu gave the Munakata gods an order.

She asked them, being halfway on the road to Karakuni (present-day China and Korea), to be sure to protect the imperial descendants, using honorific language.

[Original Japanese]